const HtmlWebpackPlugin = require("html-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin").CleanWebpackPlugin;
const webpack = require("webpack");
module.exports = {
  mode: "development",
  devtool: "source-map",
  devServer: {
    open: true,
  },
  entry: {
    main: "./src/index.js",
  },
  plugins: [
    new CleanWebpackPlugin({
      cleanOnceBeforeBuildPatterns: ["**/*", "!dll", "!dll/*"],
    }),
    new HtmlWebpackPlugin({
      template: "./public/index.html",
      chunks: ["main"],
    }),
    new webpack.DllReferencePlugin({
      manifest: require("./dll/jquery-manifest.json"),
    }),
    new webpack.DllReferencePlugin({
      manifest: require("./dll/loadsh-manifest.json"),
    }),
  ],
};
